<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>幻灯片</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<div class="container-fluid" style="margin-top: 25px;margin-bottom: 25px;width:100%">
    <div class="row">
        <div class="col-sm-2">
            <a class="btn btn-primary" href="{:url('add')}"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span>添加广告</a>
        </div>
        <form class="col-sm-10"action="{:url('search')}" method="post">
            <div class="row"  style="float:right">
                <div class="form-inline col-sm-12" style="float:right">
                    <select class="form-control input-sm col-sm-3" name="enabled">
                        <option selected>状态</option>
                        <option value="1">显示</option>
                        <option value="0">隐藏</option>
                    </select>
                    <input type="text" class="form-control col-sm-7" id="exampleInputEmail2" name="content" placeholder="">
                    <button type="submit" class="btn btn-default col-sm-2"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>搜索</button>
                </div>
            </div>
        </form>
    </div>
</div>



<table class="table table-hover" style="width:100%;margin-left: 20px">
    <tr>
        <th>顺序</th>
        <th>标题</th>
        <th>链接</th>
        <th>显示</th>
        <th>操作</th>
    </tr>
    {foreach $item as $key=>$value}
    <tr>
        <td>{$value.displayorder}</td>
        <td><img src="{$value.thumb}" /></td>
        <td>{$value.bannername}</td>
        <td>{$value.link}</td>
        {if $value.enabled == 0}
        <td><button class="btn btn-default btn-sm" disabled>隐藏</button></td>
        {else /}
        <td><button class="btn btn-primary btn-sm">显示</button></td>
        {/if}
        <td>
            <a href="{:url('edit')}?id={$value.id}">修改</a>
            <a href="{:url('delete')}?id={$value.id}">删除</a>
        </td>
    </tr>
    {/foreach}
</table>

<div>{php}echo $page{/php}</div>

</body>
</html>